/* eslint-disable */
const withLess = require("@zeit/next-less");
const path = require("path");

module.exports = withLess({
    transpileModules: ["templite", "rosetta"],
    lessLoaderOptions: {
        lessOptions: {
            javascriptEnabled: true,
        },
    },
    typescript: {
        ignoreDevErrors: true,
    },
    basePath: "/oauth2",
    experimental: {
        basePath: "/oauth2",
    },
    webpack(config, { buildId }) {
        config.module.rules[0].include.push(/templite[\\/]dist/, /rosetta[\\/]dist/);
        const { exclude } = config.module.rules[0];
        config.module.rules[0].exclude = (excludePath) => {
            if ([/templite[\\/]dist/, /rosetta[\\/]dist/].some((reg) => reg.test(excludePath))) {
                return false;
            }
            return exclude(excludePath);
        };
        return config;
    },
});
